<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>发布文章管理</title>
  <!-- 导入CSS -->
  <link rel="stylesheet" href="../../lib/layui/css/layui.css">
  <link rel="stylesheet" href="../../css/article/article-pub.css">
</head>

<body>
  <!-- 卡片区域 -->
  <div class="layui-card">
    <div class="layui-card-header">发布文章管理</div>
    <div class="layui-card-body">
      <!-- 表单结构 -->
      <form class="layui-form" lay-filter="article-form">
        <!-- 表单项 -->
        <div class="layui-form-item">
          <label class="layui-form-label">文章标题</label>
          <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" class="layui-input" placeholder="请输入文字标题">
          </div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">文章类别</label>
          <div class="layui-input-block">
            <select name="cate_id" lay-verify="required"></select>
          </div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">文章内容</label>
          <div class="layui-input-block">
            <textarea name="content" id="article-content"></textarea>
          </div>
        </div>

        <div class="layui-form-item">
          <label class="layui-form-label">文章封面</label>
          <div class="layui-input-block">
            <input type="text" hidden name="cover" id="cover" lay-verify="required">
            <input type="file" hidden id="file-input">
            <img class="upload-cover" src="../../assets/avatar.jpg" alt="">
          </div>
        </div>

        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit>发布文章</button>
            <button class="layui-btn layui-btn-primary" lay-submit id="submit2">保存草稿</button>
          </div>
        </div>
      </form>
    </div>
  </div>


  <script type="text/html" id="cate-tmp">
    <option value="">请选择文章类别</option>
    {{each data item}}
      <option value="{{item._id}}">{{item.name}}</option>
    {{/each}}
  </script>


  <!-- 导入JS -->
  <script src="../../lib/layui/layui.all.js"></script>
  <script src="../../lib/jquery.js"></script>
  <!-- 导入富文本插件 -->
  <script src="../../lib/tinymce/tinymce.min.js"></script>
  <script src="../../lib/tinymce/tinymce_setup.js"></script>

  <script src="../../lib/template-web.js"></script>
  <script src="../..//js/BASE_API.js"></script>
  <script src="../../js/article/article-pub.js"></script>
</body>

</html>